<?xml version="1.0"?>

<f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:p="http://primefaces.org/ui" xmlns:portlet="http://java.sun.com/portlet_2_0"
        xmlns:tp="http://ifeed.vgregion.com/facelets">

  <h:head></h:head>

  <portlet:defineObjects/>

  <style type="text/css">

    .rp-table>tbody>tr>th,
    .rp-table>tbody>tr>td{
    border: 1px solid #bbb;
    border-width: 0 1px 1px 0;
    padding: 5px 10px;
    text-align: left;
    }

    .ifeed-filters .icon-chevron-right, .ifeed-filters .icon-chevron-down,
    .organization-tree .icon-chevron-right, .organization-tree .icon-chevron-down {
      text-decoration:none;
      padding: 5px;
    }
    .hsa-id {
      overflow: hidden;
      white-space: nowrap;
    }



    .rp-ifeed-popup h2, .rp-ifeed-popup .box, .rp-ifeed-popup .rp-filter-value-input {
      padding: 10px;
    }

    .rp-ifeed-popup .box a {
      foo-padding: 0px;
    }

    .rp-ifeed-popup h2 {
      padding: 10px;
    }

    .ui-icon-triangle-2-s {
      background: transparent url(../img/arrows/rp-arrow-right.png) left center no-repeat;
    }

    .ui-icon-triangle-1-s {
      background: transparent url(../img/arrows/rp-arrow-down.png) left center no-repeat;
    }

    .ltr-flowing-item {
      *display: inline; display: inline-block; zoom: 1; padding: 3px; margin: 2px; vertical-align: baseline; white-space:
      nowrap;
    }

    a.ltr-flowing-item:hover, .ltr-flowing-item a:hover {
      color: black;
    }

    .doc-list td {
      min-width: 18px;
    }

    .ifeed-filter-help {
    background: url('/iFeed-portlet/img/information.png') 0 0 no-repeat;
    cursor: pointer;
    float: left;
    font-size: 0;
    height: 16px;
    margin-right: 3px;
    text-indent: -9999em;
    width: 16px;
    }

    .ifeed-filter-add {
    background: url('/iFeed-portlet/img/add.png') 0 0 no-repeat;
    cursor: pointer;
    float: left;
    font-size: 0;
    height: 16px;
    margin-right: 3px;
    text-indent: -9999em;
    width: 16px;
    }


    .ifeed-tree-closed {
    background: url('/rp-bootstrap-theme/images/arrows/rp-arrow-right.png') 0 0 no-repeat;
    cursor: pointer;
    font-size: 0;
    height: 16px;
    margin-right: 3px;
    text-indent: -9999em;
    width: 16px;
    display: inline-block;
    vertical-align: text-bottom;
    }

    tbody.ui-treetable-data.foo {
    display: inline-block;
    height: 262px;
    overflow-y: auto;
    }

    .feed-list input, .feed-list select {
      max-width: 150px;
    }

    .ifeed-border {
      border: 1px solid #c4ced5;
      -webkit-border-radius: 4px;
      border-radius: 4px;
    }

    a:visited.sub-item, a.sub-item, .sub-item {
      background-color: rgb(117, 109, 109);
      color: white;
    }

    a:visited.main-item, a.main-item, .main-item {
      background-color: rgb(40, 101, 173);
      color: white;
    }

    .createNewAdminInput input {
      vertical-align: baseline; border:1px solid transparent;
    }

    .rp-ifeed-popup {
      position:fixed;background-color:white;top:15%;min-height:400px;max-height:600px;border:1px solid #000;z-index: 100;
      border: 1px solid #c4ced5;
      overflow-y:auto;
      -webkit-border-radius: 4px;
      border-radius: 4px;
      overflow-x: hidden;
    }

    .rp-ifeed-popup-head {
      background: url(/rp-bootstrap-theme/img/portlet/portlet-hd-bg-2.png) 0pc 0pc repeat-x rgb(47, 110, 161);
    }

    .preformatted {
      white-space: pre ; display: block; unicode-bidi: embed
    }

    .ui-autocomplete{width:auto;zoom:1;cursor:pointer;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;position:relative;display:inline-block;}.ui-autocomplete .ui-autocomplete-dropdown{position:absolute;top:0;bottom:0;height:100%;}.ui-autocomplete-query{font-weight:bold;}.ui-autocomplete-panel{position:absolute;overflow:auto;}.ui-autocomplete-panel .ui-autocomplete-item{cursor:pointer;}.ui-autocomplete-panel .ui-autocomplete-list{padding:0.4em;border:0 none;}.ui-autocomplete-panel .ui-autocomplete-list-item{border:0px none;font-weight:normal;margin:1px 0;padding:3px 5px;text-align:left;}.ui-autocomplete-panel .ui-autocomplete-table{border-collapse:collapse;width:100%;}.ui-autocomplete-panel .ui-autocomplete-table th,.ui-autocomplete-panel .ui-autocomplete-table td{border-width:1px;border-style:solid;border-color:inherit;padding:4px 10px 4px 10px;}.ui-autocomplete .ui-button-icon-only .ui-button-text{padding:0.29em;}/* Multiple Selection */.ui-autocomplete-multiple-container{clear:left;cursor:text;list-style-type:none;margin:0;min-height:1px;overflow:hidden;width:400px;}.ui-autocomplete-multiple-container.ui-inputfield{padding:0;}.ui-autocomplete-token{cursor:default;float:left;overflow:hidden;padding:1px 3px;white-space:nowrap;position:relative;margin:2px;}.ui-autocomplete-token-label{display:block;padding:0em 2.1em 0em 0.5em;}.ui-autocomplete-token-icon{margin-top:-9px;position:absolute;right:0.2em;top:50%;cursor:pointer;}.ui-autocomplete-input-token{float:left;list-style-type:none;margin:1px;padding:0;}.ui-autocomplete-input-token input{border:0 none;width:140px;outline:medium none;background-color:transparent;margin:2px;}.ui-autocomplete-itemtip-content{display:none;}.ui-autocomplete-itemtip{position:absolute;display:none;padding:0.4em;}.ui-autocomplete-emptyMessage{padding:3px 5px;}.ui-autocomplete-panel .ui-autocomplete-group{font-weight:bold;cursor:default;}

    a.link-button-trash {
      display: inline-block;
      vertical-align: text-bottom;
    }

    .align-top-table td {
      vertical-align: top;
      borderFoo: none !important;
    }

    td.half {
      width: 50pc;
    }

    td.framed {
      border: lightgrey solid thin;
    }

    td.framed>* {
        padding: 10px;
      display:block;

    }

    table.framed {
      border-collapse: separate;
      border-spacing: 10px;
    }

    .ifeed-field-dc-date-issued {
      white-space: nowrap;
    }

    .ifeed-filters td {
      min-width:20px;
    }



    .align-top-table rp-table {
      border: none !important;
    }

    /* Styeling for gwt dialog */

    .gwt-PopupPanelGlass {
    background-color: #000;
    opacity: 0.3;
    filter: alpha(opacity=30);
    }

    .gwt-DialogBox .Caption {
    background: #F1F1F1;
    padding: 4px 8px 4px 4px;
    cursor: default;
    font-family: Arial Unicode MS, Arial, sans-serif;
    font-weight: bold;
    border-bottom: 1px solid #bbbbbb;
    border-top: 1px solid #D2D2D2;
    }
    .gwt-DialogBox .dialogContent {
    }
    .gwt-DialogBox .dialogMiddleCenter {
    padding: 3px;
    background: white;
    }
    .gwt-DialogBox .dialogBottomCenter {
    background: url(img/hborder.png) repeat-x 0px -2945px;
    -background: url(img/hborder_ie6.png) repeat-x 0px -2144px;
    }
    .gwt-DialogBox .dialogMiddleLeft {
    background: url(img/vborder.png) repeat-y -31px 0px;
    }
    .gwt-DialogBox .dialogMiddleRight {
    background: url(img/vborder.png) repeat-y -32px 0px;
    -background: url(img/vborder_ie6.png) repeat-y -32px 0px;
    }
    .gwt-DialogBox .dialogTopLeftInner {
    width: 10px;
    height: 8px;
    zoom: 1;
    }
    .gwt-DialogBox .dialogTopRightInner {
    width: 12px;
    zoom: 1;
    }
    .gwt-DialogBox .dialogBottomLeftInner {
    width: 10px;
    height: 12px;
    zoom: 1;
    }
    .gwt-DialogBox .dialogBottomRightInner {
    width: 12px;
    height: 12px;
    zoom: 1;
    }
    .gwt-DialogBox .dialogTopLeft {
    background: url(img/circles.png) no-repeat -20px 0px;
    -background: url(img/circles_ie6.png) no-repeat -20px 0px;
    }
    .gwt-DialogBox .dialogTopRight {
    background: url(img/circles.png) no-repeat -28px 0px;
    -background: url(img/circles_ie6.png) no-repeat -28px 0px;
    }
    .gwt-DialogBox .dialogBottomLeft {
    background: url(img/circles.png) no-repeat 0px -36px;
    -background: url(img/circles_ie6.png) no-repeat 0px -36px;
    }
    .gwt-DialogBox .dialogBottomRight {
    background: url(img/circles.png) no-repeat -8px -36px;
    -background: url(img/circles_ie6.png) no-repeat -8px -36px;
    }
    * html .gwt-DialogBox .dialogTopLeftInner {
    width: 10px;
    overflow: hidden;
    }
    * html .gwt-DialogBox .dialogTopRightInner {
    width: 12px;
    overflow: hidden;
    }
    * html .gwt-DialogBox .dialogBottomLeftInner {
    width: 10px;
    height: 12px;
    overflow: hidden;
    }
    * html .gwt-DialogBox .dialogBottomRightInner {
    width: 12px;
    height: 12px;
    overflow: hidden;
    }

  </style>

  <div class="vgr-boxed-content rp-user-bookmarks">
    <div class="hd"><span>iFeed Manager</span></div>
    <div class="bd">

      <button id="rerun-ifeed-loading" style="display: none;"></button>

      <h:form id="ifeed_view">

        <!-- Panel for navigation inside IFeed portlet -->
        <p:panel id="ifeed_panel" style="padding: 0px">

          <p:panel rendered="#{navigationModelBean.uiNavigation eq 'EDIT_JSONP'}">
            <ui:include src="edit-jsonp.xhtml"/>
          </p:panel>

          <p:panel rendered="#{navigationModelBean.uiNavigation eq 'ADMIN_DEPARTMENTS'}">
            <ui:include src="admin-departments.xhtml"/>
          </p:panel>

          <p:panel rendered="#{navigationModelBean.uiNavigation eq 'EDIT_DEPARTMENT'}">
            <ui:include src="edit-department.xhtml"/>
          </p:panel>

          <p:panel rendered="#{navigationModelBean.uiNavigation eq 'USER_IFEEDS'}">
            <ui:include src="user-ifeed-list.xhtml"/>
          </p:panel>

          <p:panel rendered="#{navigationModelBean.uiNavigation eq 'ADD_IFEED'}">
            <ui:include src="add-ifeed.xhtml"/>
          </p:panel>

          <p:panel rendered="#{navigationModelBean.uiNavigation eq 'FIELD_CONFIG'}">
            <ui:include src="field-config.xhtml"/>
          </p:panel>

          <p:panel rendered="#{navigationModelBean.uiNavigation eq 'EDIT_IFEED'}">
            <ui:include src="edit-ifeed.xhtml"/>
          </p:panel>

          <p:panel rendered="#{navigationModelBean.uiNavigation eq 'VIEW_IFEED'}">
            <ui:include src="view-ifeed.xhtml"/>
          </p:panel>

        </p:panel>

      </h:form>
    </div>
  </div>

  <script type="text/javascript">
    PrimeFaces.locales ['sv_SE'] = {
      closeText: 'Stäng',
      prevText: 'Föregående',
      nextText: 'Nästa {code}',
      monthNames: ['januari', 'februari', 'mars', 'april', 'maj', 'juni', 'juli', 'augusti', 'september', 'oktober', 'november', 'december' ],
      monthNamesShort: ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec' ],
      dayNames: ['söndag', 'måndag', 'tisdag', 'onsdag', 'torsdag', 'fredag', 'lördag'],
      dayNamesShort: ['sön', 'mån', 'tis', 'ons', 'tor', 'fre', 'lör'],
      dayNamesMin: ['sö', 'må', 'ti', 'on', 'to', 'fr', 'lö'],
      weekHeader: 'Vecka',
      firstDay: 1,
      isRTL: false,
      showMonthAfterYear: false,
      yearSuffix:'',
      timeOnlyTitle: 'Endast tid',
      timeText: 'Tid',
      hourText: 'timmar',
      minuteText: 'minuter',
      secondText: 'sekunder',
      currentText: 'Nuvarande datum',
      ampm: false,
      month: 'månad',
      week: 'vecka',
      day: 'dag',
      allDayText: 'Hela dagen'
    };
  </script>

</f:view>